<template>
  <img :src="src" alt />
</template>

<script setup>
import { reactive, toRefs, onMounted, ref, watch } from 'vue'

const props = defineProps({
  url: {
    type: String,
    default: ''
  }
})
const src = ref('')
watch(() => props.url, (url) => {
  if (url) {
    console.log('url',url);
    const xhr = new XMLHttpRequest();
    xhr.responseType = 'arraybuffer';
    xhr.open('GET', url);
    xhr.onload = (e) => {
      src.value = UTIF.bufferToURI(xhr.response)
    }
    xhr.send()
  }
},{immediate:true})

</script>
<style lang='scss' scoped>
</style>